package app.auto.runner.base.utility.base;

import android.app.Activity;
import android.content.Intent;

import java.util.Locale;

import app.auto.AndroidInstance;

public class AppUtil extends AndroidInstance {


    private static Locale locale;


    public Activity getActivity() {
        return (Activity) getContext();
    }

    public static void restartApp(Activity activity, Class<?> homeClass) {
        Intent intent = new Intent(activity, homeClass);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        activity.startActivity(intent);
        // 杀掉进程
        android.os.Process.killProcess(android.os.Process.myPid());
        System.exit(0);
    }

    @Override
    public AndroidInstance use(Object o, Object... objects) {
        return null;
    }
}
